# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-2019, Intel Corporation.

#
# Makefile for the Intel(R) Ethernet Connection E800 (ice.ko) driver
#

obj-m += ice.o

ice-objs := ice_main.o	\
	kcompat.o	\
	ice_controlq.o	\
	ice_common.o	\
	ice_nvm.o	\
	ice_switch.o	\
	ice_sched.o	\
	ice_base.o	\
	ice_lib.o	\
	ice_txrx_lib.o	\
	ice_txrx.o	\
	ice_fltr.o	\
	ice_vsi_vlan_ops.o \
	ice_fdir.o	\
	ice_ethtool_fdir.o	\
	ice_acl_main.o		\
	ice_acl.o		\
	ice_acl_ctrl.o		\
	ice_vlan_mode.o	\
	ice_flex_pipe.o	\
	ice_flow.o		\
	ice_lag.o		\
	ice_ethtool.o

CFLAGS_ice_main.o := -I$(src)

ice-$(CONFIG_NET_DEVLINK:m=y) += ice_devlink.o ice_fw_update.o
ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o
ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
ice-$(CONFIG_DEBUG_FS) += ice_debugfs.o
ice-$(CONFIG_MFD_CORE:m=y) += ice_idc.o
ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o ice_virtchnl_allowlist.o ice_dcf.o ice_virtchnl_fdir.o
ice-$(CONFIG_PTP_1588_CLOCK:m=y) += ice_ptp.o
ice-$(CONFIG_PTP_1588_CLOCK:m=y) += ice_cgu_ops.o ice_cgu_util.o
ifndef CONFIG_PLDMFW
ice-y += kcompat_pldmfw.o
endif
#ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
#ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o

EXTRA_CFLAGS += -DHAVE_PF_RING
KBUILD_EXTRA_SYMBOLS=${PF_RING_PATH}/Module.symvers

KVER=$(shell uname -r)

all:
	cd ${PF_RING_PATH}/; make
	cp ${PF_RING_PATH}/Module.symvers .
	$(MAKE) -C /lib/modules/${KVER}/build M=$(PWD) modules

clean:
	$(MAKE) -C /lib/modules/${KVER}/build M=$(PWD) clean

